/**
 * Created by DELL on 2017/4/18.
 */
// const testHelper=require('./ulti/sortTestHelper');
const swap=require('./ulti/swap');
const shellSort=function(arr){
    var len=arr.length,gap,temp,i,j;
    for(gap=Math.floor(len/2);gap>0;gap=Math.floor(gap/2)){
        for( i=1+gap;i<len;i+=gap){
            //以gap为标准 跳跃选取对比值,来决定是否插入
            temp=arr[i];
            for(j=i-gap;j>=0&&arr[j]>temp;j-=gap){
                arr[j+gap]=arr[j];
            }
            arr[j+gap]=temp;
        }
    }
    console.log('希尔排序:');
};
module.exports=shellSort;